<?php

namespace pam\Form;

/**
 * Description of PolicyFieldset
 *
 * @author Robert Bwana
 */
use Zend\Form\Fieldset;
use pam\Model\Policy;
use Zend\Stdlib\Hydrator\ClassMethods;

class PolicyFieldset extends Fieldset {

    public function __construct($name = null, $options = array()) {
        parent::__construct($name, $options);

        $this->setHydrator(new ClassMethods(FALSE));
        $this->setObject(new Policy);

        $this->add(array(
            'type' => 'hidden',
            'name' => 'id'
        ));

        $this->add(array(
            'type' => 'text',
            'name' => 'policy_name',
            'options' => array(
                'label' => 'Policy Name',
            )
        ));

        $this->add(array(
            'type' => 'Zend\Form\Element\DateSelect',
            'name' => 'policy_date',
            'options' => array(
                'label' => 'Policy Date'
            )
        ));

        $this->add(array(
            'type' => 'textarea',
            'name' => 'policy_description',
            'options' => array(
                'label' => 'Policy Description'
            )
        ));
    }

}
